//
//  ConAlreadyAdderViewController.m
//  Shengzhuli
//
//  Created by FXGuo on 2017/8/11.
//  Copyright © 2017年 kamangkeji. All rights reserved.
//

#import "ConAlreadyAdderViewController.h"
#import "AdderImageCell.h"
#import "AdderPrivilegeCell.h"
#import "ConClubShowViewController.h"

@interface ConAlreadyAdderViewController ()

@end

@implementation ConAlreadyAdderViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"已成为合伙人";
    [self setNavi];
    [self setUpTableView];
}
- (void)setNavi
{
    CGSize imageSize = CGSizeMake(320,64);
    UIGraphicsBeginImageContextWithOptions(imageSize,0, [UIScreen mainScreen].scale);
    [RGBColor(40, 140, 234) set];
    UIRectFill(CGRectMake(0,0, imageSize.width, imageSize.height));
    UIImage *pressedColorImg = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    [self.navigationController.navigationBar setBackgroundImage:pressedColorImg forBarMetrics:UIBarMetricsDefault];
    [self.navigationController.navigationBar setShadowImage:[UIImage new]];
    
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
    
    self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor],NSFontAttributeName:[UIFont systemFontOfSize:20]};
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 2;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row == 0) {
        return 225;
    }
    return 340;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row == 0) {
        AdderImageCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([AdderImageCell class])];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        return cell;
    }
    AdderPrivilegeCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([AdderPrivilegeCell class])];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    cell.clubBlock = ^{
        ConClubShowViewController *showVc = [[ConClubShowViewController alloc]init];
        showVc.source = ClubShowSourcePerson;
        [self.navigationController pushViewController:showVc animated:YES];
    };
    return cell;
}
- (void)setUpTableView
{
    self.tableView.tableFooterView = [[UIView alloc]init];
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.tableView.bounces = NO;
    [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([AdderImageCell class]) bundle:nil] forCellReuseIdentifier:NSStringFromClass([AdderImageCell class])];
    [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([AdderPrivilegeCell class]) bundle:nil] forCellReuseIdentifier:NSStringFromClass([AdderPrivilegeCell class])];
}

@end
